<?php
class ControllerModuleSearchresult extends Controller
{
	public function index()
	{
		//$mediaid = $this->request->get['mediaid'];
		
		$this->getList();
	}
	
	private function getList()
	{
		$this->load->model("core/media");
		$this->load->helper('image');
		
		$sitemapid ="";
		//$mediaid = $this->request->get['mediaid'];
		$siteid = $this->user->getSiteId();
		$step = (int)$this->request->get['step'];
		$to = 10;
		
		//Get list
		$arrmediatype = array('content',"product");
		$queryoptions = array();
		$queryoptions['mediaparent'] = '%';
		$queryoptions['mediatype'] = $arrmediatype;
		$queryoptions['refersitemap'] = '%';
		$queryoptions['keyword'] = $this->request->get['keyword'];
		
		
		$medias = $this->model_core_media->getPaginationList($queryoptions, $step, $to);
				
		$this->data = $this->model_core_media->viewNews($medias,180,180);
		$querystring = "index.php?route=page/detail&sitemapid=search";
		
		$pagelinks = $this->model_core_media->getPaginationLinks($step, $queryoptions, $querystring, $step, $to);
		
		$this->data['nextlink'] = $pagelinks['nextlink'];
		$this->data['prevlink'] = $pagelinks['prevlink'];
		
		$this->id="news";
		$this->template="module/searchresult.tpl";
		$this->render();
	
	}
}
?>